<!-- 我的提问 -->
<template>
	<view class="page">
		<!-- 搜索 -->
		<search></search>
		<!-- 列表 -->
		<List></List>
	</view>
</template>

<script setup>
	import { onLoad, onUnload, onReachBottom } from "@dcloudio/uni-app";
	import { useMyAskStore } from "./store.js";
	import search from './components/search.vue';
	import List from './components/list.vue';
	
	const store = useMyAskStore();
	
	onLoad(() => {
		store.getList();
		uni.$on('refresh-my-ask-page', store.refreshList); // 删贴时刷新
	});
	
	onReachBottom(() => {
		store.getList();
	});
	
	onUnload(() => {
		store.RESET_STORE();
		uni.$off('refresh-my-ask-page', store.refreshList);
	});
</script>

<style lang="scss" scoped>
</style>